package com.jm.pojo;

import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

/**
 * 用户信息
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName("user")
public class User implements Serializable {

    private static final long serialVersionUID = 1L;
    //    id
    @TableId
    private Long id;
    //    名字
    private String name;
    //    手机号
    private String phone;
    //    密码
    private String password;
    //    性别
    private String sex;
    //    身份证号
    private String idNumber;
    //    头像
    private String avatar;
    //    状态
    private Integer status;

    public User(String phone) {
        this.phone = phone;
        this.name = "用户" + phone.substring(phone.length() - 4);
        this.password = phone.substring(phone.length() - 6);
        this.sex = "1";
        this.status = 1;
        this.avatar="headPage.png";
    }

}

